use winit::{dpi::*, };
use ash::{vk::{self, *}, };

pub fn get_extent_from_physical_size(py_size: PhysicalSize<u32>) -> vk::Extent2D {
    return vk::Extent2D {
        width: py_size.width,
        height: py_size.height,
    };
}

pub fn get_physical_size_from_extent(extent: vk::Extent2D) -> PhysicalSize<u32> {
    return PhysicalSize {
        width: extent.width,
        height: extent.height,
    };
}

pub fn struct_to_bytes<T: Sized>(s: &T) -> &[u8] {
    unsafe {
        std::slice::from_raw_parts(
            s as *const T as *const u8,
            std::mem::size_of::<T>(),
        )
    }
}
